<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:composite="http://xmlns.jcp.org/jsf/composite">

    <h:body>
        <composite:interface>
            <composite:attribute name="bean" required="true"/>
        </composite:interface>

        <composite:implementation>
            <p:dialog id="profileFilterDialog" header="#{messages.Profile}" modal="true" position="top" resizable="false" widgetVar="profileFilterDialog">
                <p:panel id="profileFilterPanel" styleClass="noBorder noPadding noMargin">
                    <h:form id="profileFilterForm">
                        <p:inputText id="profileName" value="#{cc.attrs.bean.nameCollector}" required="false" label="#{messages.Name}"></p:inputText>
                        <p:watermark for="profileName" value="#{messages.Name}" />

                        <p:calendar pattern="dd/MM/yyyy" navigator="true" id="profileFromDate" value="#{cc.attrs.bean.fromDateCollector}" required="false" label="#{messages.FromDate}"></p:calendar>
                        <p:calendar pattern="dd/MM/yyyy" navigator="true" id="profileToDate" value="#{cc.attrs.bean.toDateCollector}" required="false" label="#{messages.ToDate}"></p:calendar>

                        <p:selectOneMenu filter="true" filterMatchMode="contains" id="profileIsRelated" value="#{cc.attrs.bean.isRelatedCollector}" effect="fade" required="false" label="#{messages.Related}">  
                            <f:selectItem itemLabel="#{messages.Indiferent}" itemValue="" />  
                            <f:selectItem itemLabel="#{messages.Related}" itemValue="#{true}" />
                            <f:selectItem itemLabel="#{messages.NoRelated}" itemValue="#{false}" />
                        </p:selectOneMenu>

                        <p:commandButton value="#{messages.Add}" process="@parent" styleClass="blueBackgroundStrong" actionListener="#{cc.attrs.bean.addProfileRequeriments()}" oncomplete="if (args &amp;&amp; !args.validationFailed){PF('profileFilterDialog').hide();reinitWaypoint();}" update=":createSearchForm:searchGrowl :createSearchForm:searchPanel :facesPanel :totalFacesForm :createSearchForm:addFilterPanel" />
                        <p:commandButton value="#{messages.Cancel}" process="@this" styleClass="grayBackgroundStrong" style="margin-left: 3%;" actionListener="#{cc.attrs.bean.cancelProfileRequeriments()}" oncomplete="PF('profileFilterDialog').hide();"/>
                    </h:form>
                </p:panel>
            </p:dialog>
        </composite:implementation>
    </h:body>
</html>